---
title: "Validate Pipeline"
api: "POST /v1/pipeline/validate"
description: "Validate a pipeline configuration without saving it"
---

Check if a pipeline configuration is valid before creating or updating a pipeline.

## Examples

<CodeGroup>

```python Python
from chonkie.cloud import Pipeline

# Validate steps configuration
steps = [
    {"type": "chunk", "component": "recursive", "chunk_size": 512},
    {"type": "refine", "component": "overlap", "context_size": 64}
]

is_valid, errors = Pipeline.validate(steps)

if is_valid:
    print("Configuration is valid!")
else:
    print(f"Errors: {errors}")
```

```typescript JavaScript
import { Pipeline } from '@chonkiejs/cloud';

// Validate steps configuration
const steps = [
  { type: 'chunk', component: 'recursive', chunk_size: 512 },
  { type: 'refine', component: 'overlap', context_size: 64 },
];

const { valid, errors } = await Pipeline.validate(steps);

if (valid) {
  console.log('Configuration is valid!');
} else {
  console.log(`Errors: ${errors}`);
}
```

```bash cURL
curl -X POST https://api.chonkie.ai/v1/pipeline/validate \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "steps": [
      {"type": "chunk", "component": "recursive", "chunk_size": 512},
      {"type": "refine", "component": "overlap", "context_size": 64}
    ]
  }'
```

</CodeGroup>

## Request

<ParamField path="steps" type="array" required>
  Array of pipeline step configurations to validate.

  Each step object contains:
  - `type`: Step type (`process`, `chunk`, or `refine`)
  - `component`: Component name (e.g., `recursive`, `overlap`, `embeddings`)
  - Additional parameters specific to the component
</ParamField>

## Response

<ResponseField name="valid" type="boolean">
  Whether the configuration is valid.
</ResponseField>

<ResponseField name="message" type="string">
  Human-readable validation result message.
</ResponseField>

<ResponseField name="errors" type="array">
  List of validation errors if the configuration is invalid. Null if valid.
</ResponseField>

## Validation Rules

The validation endpoint checks:

1. **Required chunk step**: At least one `chunk` step must be present
2. **Valid step types**: Only `process`, `chunk`, and `refine` are allowed
3. **Valid components**: Component names must match available chunkers, refiners, or processors
4. **Valid parameters**: Component-specific parameters are validated

## Errors

| Status | Description |
|--------|-------------|
| 422 | Invalid request format |
